from django.urls import path
from . import views
from django.conf import settings
from django.conf.urls.static import static

urlpatterns = [
    path('', views.toLogin_view, name='toLogin'),
    path('login/', views.login_view,name='login'),
    path('toregister/', views.toRegister_view, name='toRegister'),
    #因为主路由中只有polls应用，所以访问时要添加polls/
    path('register/', views.register_view, name='register'),
    path('index/', views.toIndex_view, name='index'),
    path('torename/', views.toRename_view, name='toRename'),
    path('rename/', views.rename_view, name='rename'),
    path('dynasty/', views.toDynasty_view, name='toDynasty'),
    path('update_dynasty/', views.dyupdate_view, name='update', kwargs={'model_name': 'dynasty'}),
    path('update_character/', views.chupdate_view, name='character', kwargs={'model_name': 'character'}),
    path('character/', views.toCharacter_view, name='toCharacter'),
    path('chart/',views.toChart_view, name='toChart'),
    # path('literature/', views.toLiterature_view, name='toLiterature'),
    path('dynasty/delete/<int:id>/', views.delete_view, name='dynasty_delete',
         kwargs={'model_name': 'dynasty'}),
    path('character/delete/<int:id>/', views.delete_view, name='character_delete',
         kwargs={'model_name': 'character'}),
    path('find/', views.tofind_view, name='find'),

] + static(settings.MEDIA_URL, document_root=settings.MEDIA_ROOT)